package work20241129.oop3;

/**
 * @author zdl
 * @date 2024/11/29
 */
public class Demo1 {
    public static void main(String[] args) {
        Person person = new Person();
        //赋值
        person.name = "张三";
        person.age = 20;
        person.sex='男';
        //取值
        System.out.println(person.name);
        System.out.println(person.age);
        System.out.println(person.sex);
        //调用方法
        person.eat();
        person.sleep();
    }
}
